// 评议栏

import { POST as post, GET as get } from '../axios.config.js'
const base = config.ip
const projectName = '/rcdg-record'
// 指标
const projectName1 = '/topnet-assess'

/* 评议栏 开始 */

// 获取评价指标体系
export const getAssessTarget = p => post(`${base}${projectName1}/sa-leader-assess/getAssessTarget`, p)

// 获取指标评价内容
export const getAssessContent = p => post(`${base}${projectName1}/sa-leader-assess/getAssessContent`, p)

// 保存指标评价内容
export const saveAssessScore = p => post(`${base}${projectName1}/sa-leader-assess/saveAssessScore`, p)

// 催报
export const saveUrgeByNeedDeal = p => post(`${base}${projectName}/form-progress/saveUrgeByNeedDeal`, p)

// 【周/月的填报情况】获取我要评议的详情页面
export const selectCommentBarDetailsSecord = p =>
  post(`${base}${projectName}/sa-comment-item/selectCommentBarDetailsSecord`, p)
// 【周/月的填报情况】获取我要评议的详情页面 noLoading
export const selectCommentBarDetailsSecordNoLoading = p =>
  post(`${base}${projectName}/sa-comment-item/selectCommentBarDetailsSecord`, p, {
    headers: {
      hideLoading: true,
    },
  })

/**
 * 查找评议栏待评 / 已评议列表
 *
 * @param {Number} status
 * 0: 待评
 * 1: 已评
 * @returns
 */
export const getCommentData = (status = 0) =>
  post(`${base}${projectName1}/sa-comment-column/getCommentData`, {
    status,
  })

/**
 *
 * 检查评价信息的提交问题
 *
 * @param {待办ID} needId
 * @param {是否检验评优人数 0 不检验 1检验} isCheckGood
 * @returns
 */
export const checkSubmitAllAssess = (needId, isCheckGood = 1) =>
  post(`${base}${projectName1}/sa-leader-assess/checkSubmitAllAssess`, {
    needId,
    isCheckGood,
  })

/**
 *
 * 提交所有人员的评价信息
 *
 * @param {待办ID} needId
 * @param {是否检验评优人数 0 不检验 1检验} isCheckGood
 * @returns
 */
export const submitAllAssess = (needId, isCheckGood = 0) =>
  post(`${base}${projectName1}/sa-leader-assess/submitAllAssess`, {
    needId,
    isCheckGood,
  })

/**
 * 主要领导评价
 * 获取用户考核数据
 *
 * @param {String} needId
 * 待办ID
 * @returns
 */
export const getUserAssessData = needId =>
  post(`${base}${projectName1}/sa-leader-assess/getUserAssessData`, {
    needId,
  })

// 保存简要评价内容---保存只打总分
export const saveSimpleAssess = p => post(`${base}${projectName1}/sa-leader-assess/saveSimpleAssess`, p)
// 获取指定用户加减分列表
export const getCalcScoreByUserId = p => post(`${base}${projectName1}/sa-leader-assess/getCalcScoreByUserId`, p)
// 批量评分
export const getListAssessContent = p => post(`${base}${projectName1}/sa-leader-assess/listAssessContent`, p)

// 获取用户历史考核数据
export const getUserHistoryAssessData = p => post(`${base}${projectName1}/sa-leader-assess/getUserHistoryAssessData`, p)

// 根据待办id获取好等次配置选项数据
export const getlistGoodConfigByNeedId = p => post(`${base}${projectName1}/sa-assess-config/listGoodConfigByNeedId`, p)

// 选择本季度的好等次人数限制
export const chooseGoodConfig = p => post(`${base}${projectName1}/sa-assess-config/chooseGoodConfig`, p)

/* 评议栏 结束 */

// 获取人员列表
export const getFirstAssessData = p => post(`${base}${projectName1}/sa-leader-assess/getFirstAssessData`, p)

// V2查询评价页季总结
export const getScoreQuarterRecordForm = p => post(`${base}${projectName}/record-base/v2/getScoreQuarterRecordForm`, p)
// V2查询评价页季总结 noLoading
export const getScoreQuarterRecordFormNoLoading = p =>
  post(`${base}${projectName}/record-base/v2/getScoreQuarterRecordForm`, p, {
    headers: {
      hideLoading: true,
    },
  })

// V2查询季度评价页周月纪实
export const getScoreSideBarRecordForm = p => post(`${base}${projectName}/record-base/v2/getScoreSideBarRecordForm`, p)

// V2查询季度评价页周月纪实 noLoading
export const getScoreSideBarRecordFormNoLoading = p =>
  post(`${base}${projectName}/record-base/v2/getScoreSideBarRecordForm`, p, {
    headers: {
      hideLoading: true,
    },
  })

// 分页获取评定列表
export const pageYearAssList = p => get(`${base}${projectName}/year-assess/pageYearAssList`, p)

// 保存考核等次
export const saveYearAss = p => post(`${base}${projectName}/year-assess/saveYearAss`, p)

// 提交考核等次
export const subYearAss = p => post(`${base}${projectName}/year-assess/subYearAss`, p)

// 查询下拉年度考核年份
export const listAssYear = p => post(`${base}${projectName}/year-assess/listAssYear`, p)

// 查询下拉年度考核机构
export const listAssOrg = p => post(`${base}${projectName}/year-assess/listAssOrg`, p)

// 查询年度考核统计信息
export const getYearAssStat = p => post(`${base}${projectName}/year-assess/getYearAssStat`, p)
